# Author:Yiye
# -*- codeing = utf-8 -*-
# @Time :2021/11/11 12:29
# @Author:李卓
# @Site : 
# @File : get请求.py
# @Software : PyCharm
import  urllib.request
import  urllib.parse
url = 'https://www.baidu.com/s?wd='
name = urllib.parse.quote('周杰伦')
url = url + name
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36'
}
request = urllib.request.Request(url=url,headers=headers)
response = urllib.request.urlopen(request)
content = response.read().decode('utf8')
print(content)
